package de.fzi.kasma.learner.path;
import edu.unika.aifb.graphindex.data.Table;
import edu.unika.aifb.graphindex.index.IndexDirectory;
import edu.unika.aifb.graphindex.index.IndexReader;
import edu.unika.aifb.graphindex.query.StructuredQuery;
import edu.unika.aifb.graphindex.searcher.structured.VPEvaluator;

public class TestQuery {
	public static void main(String[] args) throws Exception {
		IndexReader ir = new IndexReader(new IndexDirectory("data/halfminset"));
		StructuredQuery q = new StructuredQuery("q1");
		q.addEdge("?u", "http://www.movie.org/ontology.owl#like", "?m");
		q.addEdge("?m", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
				"http://www.movie.org/ontology.owl#Movie");
		q.addEdge("?u", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
				"http://www.movie.org/ontology.owl#User");
		q.addEdge("http://www.movie.org/resource/21",
				"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
				"http://www.movie.org/ontology.owl#Age");
		q.addEdge("?u", "http://www.movie.org/ontology.owl#hasAge",
				"http://www.movie.org/resource/21");
		q.addEdge("http://www.movie.org/resource/Dan",
				"http://www.movie.org/ontology.owl#hasAge", "?v130");
		q.addEdge("?v130", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
				"http://www.movie.org/ontology.owl#Age");
		VPEvaluator eval = new VPEvaluator(ir);
		Table<String> result = eval.evaluate(q);
		System.out.println(result);
	}
}
